
$(document).ready(function () {
	$("a[name='step1']").click(function () {
		$("#segment1").show();
		$("#segment2").hide();
		$("#segment3").hide();
		$("#segment4").hide();
	});
	$("a[name='step2']").click(function () {
		if (!carParamCheck()) {
			return false;
		}
		$("#segment1").hide();
		$("#segment2").show();
		$("#segment3").hide();
		$("#segment4").hide();
	});
	$("a[name='step3']").click(function () {
		$("#segment1").hide();
		$("#segment2").hide();
		$("#segment3").show();
		$("#segment4").hide();
	});
	$("a[name='step4']").click(function () {
		$("#segment1").hide();
		$("#segment2").hide();
		$("#segment3").hide();
		$("#segment4").show();
	});
});
function carParamCheck() {
	$("#carTypeError").html("");
	$("#carLicenseError").html("");
	var carType = $("#carType").val();
	if (carType == null || carType == "") {
		$("#carTypeError").html("\u8bf7\u8f93\u5165\u8f66\u8f86\u7c7b\u578b");
		return false;
	}
	var carLicense = $("#carLicense").val();
	if (carLicense == null || carLicense == "") {
		$("#carLicenseError").html("\u8bf7\u8f93\u5165\u8f66\u724c\u53f7");
		return false;
	}
	var status = false;
	
	$.ajax({
            url: "carLicenseValidate.do",  
            type: "get",      
            async: false,
            data: {carLicense:carLicense},
            success: function(msg) {
                status=true;
            }
     });
	
	return status;
}
	
